/*
 * Copyright 2017-present, Yudong (Dom) Wang
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.wisdom.tool.gui;

import org.wisdom.tool.constant.RESTConst;
import org.wisdom.tool.gui.hist.HistView;
import org.wisdom.tool.gui.req.ReqView;
import org.wisdom.tool.gui.rsp.RspView;

import javax.swing.*;
import javax.swing.border.TitledBorder;
import javax.swing.table.TableColumn;
import java.awt.*;

/**
 * @ClassName: RESTView
 * @Description: Rest view frame
 * @Author: Yudong (Dom) Wang
 * @Email: wisdomtool@qq.com
 * @Date: Jan 20, 2017 12:30:29 PM
 * @Version: Wisdom RESTClient V1.2
 */
public class RESTView extends JPanel {
    private static final long serialVersionUID = 957993921065702646L;

    private static RESTView view = null;

    private ReqView vReq = null;

    private RspView vRsp = null;

    private HistView vHist = null;

    private JTabbedPane tp = null;

    public RESTView() {
        this.init();
    }

    public static RESTView getView() {
        if (null == view) {
            view = new RESTView();
        }
        return view;
    }

    public ReqView getReqView() {
        return vReq;
    }

    public RspView getRspView() {
        return vRsp;
    }

    public HistView getHistView() {
        return vHist;
    }

    public JTabbedPane getTabPane() {
        return tp;
    }

    /**
     * @param
     * @return void
     * @throws
     * @Title: init
     * @Description: Component Initialization
     */
    private void init() {
        vReq = new ReqView();
        vRsp = new RspView();
        vHist = new HistView();

        JPanel mainJPanel = new JPanel();
        mainJPanel.add(vReq);
        mainJPanel.add(vRsp);
        tp = new JTabbedPane();
        tp.add("请求", mainJPanel);

        tp.add("历史", vHist);

        this.add(tp);
    }
}
